Skip to content

Conversation

@Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Oct 3, 2025

And the related object schemas
Additionally the existing PackageDependency type needs to be renamed to
be more accurate. As it's a package dependency returned with the package
listing

@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Renames packageDependencySchemapackageListingDependencySchema and PackageDependencyPackageListingDependency; updates ListingDependency prop type and PackageListingDetails.dependencies. Adds packageVersionDependencySchema/PackageVersionDependency, request params/query schemas, and a paginated packageVersionDependenciesResponseDataSchema/type. Implements fetchPackageVersionDependencies and re-exports it. Adds Dapper/DapperTs getPackageVersionDependencies methods and a dapper-fake paginator. Adds a skipped unit test for package version dependencies and adds versionNumber: "1.0.0" to test defaultConfig.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary addition of the fetchPackageVersionDependencies function to the thunderstore-api, which aligns with the PR’s main objective of introducing that API endpoint. It is specific, concise, and directly tied to the core change.
Description Check ✅ Passed The description directly references the addition of related object schemas and the renaming of the PackageDependency type, which are key aspects of the changeset. It may be brief but remains on-topic and accurately reflects changes made.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1)

21-23: Schema validation assertion could be clearer.

The assertion expect(packageVersionDependenciesResponseDataSchema.parse(response)).toBe(response) will always pass because Zod's parse returns the input when validation succeeds. Consider asserting on specific response fields or just calling parse to verify validation without the .toBe() check.

Apply this diff for a clearer assertion:

-  expect(packageVersionDependenciesResponseDataSchema.parse(response)).toBe(
-    response
-  );
+  // Validate response structure
+  packageVersionDependenciesResponseDataSchema.parse(response);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37e7161 and 59df60b.

📒 Files selected for processing (10)
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1 hunks)
  • packages/dapper/src/types/package.ts (2 hunks)
  • packages/thunderstore-api/src/__tests__/defaultConfig.ts (1 hunks)
  • packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1 hunks)
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts (1 hunks)
  • packages/thunderstore-api/src/index.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/objectSchemas.ts (3 hunks)
  • packages/thunderstore-api/src/schemas/queryParamSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/requestSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/responseSchemas.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageListingDependencySchema (145-153)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageVersionDependencySchema (230-238)
packages/dapper/src/types/package.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • PackageListingDependency (155-157)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (3)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)
  • testData (11-16)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (1)
  • fetchPackageVersionDependencies (11-35)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageListingDependency (37-45)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (5)
packages/thunderstore-api/src/index.ts (1)
  • ApiEndpointProps (9-15)
packages/thunderstore-api/src/schemas/requestSchemas.ts (1)
  • PackageVersionDependenciesRequestParams (198-200)
packages/thunderstore-api/src/schemas/queryParamSchemas.ts (2)
  • PackageVersionDependenciesRequestQueryParams (83-85)
  • packageVersionDependenciesRequestQueryParamsSchema (79-81)
packages/thunderstore-api/src/schemas/responseSchemas.ts (2)
  • PackageVersionDependenciesResponseData (142-144)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/apiFetch.ts (1)
  • apiFetch (59-114)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (7)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)

15-15: LGTM!

The addition of versionNumber to test data properly supports the new package version dependencies endpoint tests.

packages/dapper/src/types/package.ts (1)

26-26: LGTM!

The rename from PackageDependency to PackageListingDependency better clarifies the scope of this type (listing-level vs. version-level dependencies). The change is consistent with the new schema naming introduced in the thunderstore-api package.

Also applies to: 37-45

packages/thunderstore-api/src/schemas/requestSchemas.ts (1)

191-200: LGTM!

The new request params schema follows the established pattern and correctly includes the three required path parameters for the package version dependencies endpoint.

packages/thunderstore-api/src/index.ts (1)

36-36: LGTM!

The export is correctly placed in alphabetical order and exposes the new fetchPackageVersionDependencies function.

apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)

1-1: LGTM!

The type update correctly reflects the schema rename from packageDependencySchema to packageListingDependencySchema with no behavioral changes.

Also applies to: 6-6

packages/thunderstore-api/src/schemas/queryParamSchemas.ts (1)

78-85: LGTM!

The query params schema correctly defines pagination support for the package version dependencies endpoint, reusing the existing pageQueryParam definition.

packages/thunderstore-api/src/schemas/responseSchemas.ts (1)

135-144: LGTM!

The response schema follows the established paginated response pattern and correctly uses packageVersionDependencySchema for the results array.

@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 59df60b to fb0216b Compare October 3, 2025 14:58
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch 2 times, most recently from 1f3e6ac to 6a1591e Compare October 3, 2025 15:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (2)

16-16: Remove the typo and extra field.

The queryParams contains a typo impotent (likely meant to be important or removed entirely). Additionally, this field is not part of the query param schema and should be removed.

Apply this diff:

-    queryParams: [{ key: "page", value: 1, impotent: 1 }],
+    queryParams: [{ key: "page", value: 1 }],

21-23: Use toEqual for value comparison.

Schema validation tests should use toEqual() rather than toBe() since parse() may return a new object instance with identical values.

This is already correctly implemented in the current code.

🧹 Nitpick comments (1)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1)

15-15: Remove unnecessary data property.

The data: {} is not needed for GET endpoints and can be removed for clarity.

Apply this diff:

     params: {
       namespace_id: namespaceId,
       package_name: packageName,
       version_number: versionNumber,
     },
-    data: {},
     queryParams: [{ key: "page", value: 1 }],
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb0216b and 6a1591e.

📒 Files selected for processing (9)
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1 hunks)
  • packages/dapper/src/types/package.ts (2 hunks)
  • packages/thunderstore-api/src/__tests__/defaultConfig.ts (1 hunks)
  • packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1 hunks)
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts (1 hunks)
  • packages/thunderstore-api/src/index.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/objectSchemas.ts (3 hunks)
  • packages/thunderstore-api/src/schemas/requestSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/responseSchemas.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/thunderstore-api/src/index.ts
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts
  • packages/thunderstore-api/src/schemas/requestSchemas.ts
  • packages/dapper/src/types/package.ts
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx
  • packages/thunderstore-api/src/schemas/responseSchemas.ts
🧰 Additional context used
🧬 Code graph analysis (2)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (3)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)
  • testData (11-16)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (1)
  • fetchPackageVersionDependencies (11-35)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageListingDependency (37-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (3)
packages/thunderstore-api/src/schemas/objectSchemas.ts (2)

145-157: LGTM on the rename.

The rename from PackageDependency to PackageListingDependency better clarifies this type represents dependencies in package listings.


230-242: Confirm icon_url nullability in packageVersionDependencySchema
All other dependency schemas use z.string().nullable() for icon_url, but here it’s non-nullable. Verify this matches the API contract.

packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)

15-15: LGTM.

The addition of versionNumber to test data supports the new package version dependencies endpoint tests.

This was referenced Oct 3, 2025
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 6a1591e to 7e24978 Compare October 8, 2025 16:09
@Oksamies Oksamies changed the base branch from master to graphite-base/1566 October 8, 2025 16:09
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 7e24978 to e85a2f2 Compare October 8, 2025 16:09
@Oksamies Oksamies changed the base branch from graphite-base/1566 to 10-08-update_thunderstore_django_image_version_that_is_used_in_test_backend October 8, 2025 16:10
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch 2 times, most recently from 03b9884 to bb8b2b3 Compare October 8, 2025 16:14
@Oksamies Oksamies force-pushed the 10-08-update_thunderstore_django_image_version_that_is_used_in_test_backend branch from 39d4e4c to 0fd7270 Compare October 8, 2025 16:14
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from bb8b2b3 to dfca211 Compare October 8, 2025 16:24
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from dfca211 to f678762 Compare October 10, 2025 09:22
@Oksamies Oksamies force-pushed the 10-08-update_thunderstore_django_image_version_that_is_used_in_test_backend branch 2 times, most recently from 0fb7cb8 to e7db45a Compare October 10, 2025 09:38
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from f678762 to 4079e50 Compare October 10, 2025 09:38
Base automatically changed from 10-08-update_thunderstore_django_image_version_that_is_used_in_test_backend to master October 13, 2025 10:14
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 4079e50 to 939c153 Compare October 13, 2025 11:10
And the related object schemas
Additionally the existing PackageDependency type needs to be renamed to
be more accurate. As it's a package dependency returned with the package
listing
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 939c153 to b133488 Compare October 13, 2025 12:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)

249-261: Verify icon_url nullability for consistency.

The icon_url field differs between the two dependency schemas:

  • packageListingDependencySchema (line 148): icon_url: z.string().nullable()
  • packageVersionDependencySchema (line 251): icon_url: z.string()

If the API can return null for icon_url in version dependencies, the current schema will fail validation.

Confirm whether the API returns nullable icon_url for package version dependencies. If so, apply the fix suggested in the existing review comment.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 939c153 and b133488.

📒 Files selected for processing (9)
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1 hunks)
  • packages/dapper/src/types/package.ts (2 hunks)
  • packages/thunderstore-api/src/__tests__/defaultConfig.ts (1 hunks)
  • packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1 hunks)
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts (1 hunks)
  • packages/thunderstore-api/src/index.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/objectSchemas.ts (3 hunks)
  • packages/thunderstore-api/src/schemas/requestSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/responseSchemas.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/thunderstore-api/src/index.ts
  • packages/thunderstore-api/src/tests/defaultConfig.ts
  • packages/thunderstore-api/src/schemas/requestSchemas.ts
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts
  • packages/thunderstore-api/src/get/tests/packageVersionDependencies.test.ts
🧰 Additional context used
🧬 Code graph analysis (4)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageVersionDependencySchema (249-257)
packages/dapper/src/types/package.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • PackageListingDependency (155-157)
apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageListingDependencySchema (145-153)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageListingDependency (37-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (3)
packages/dapper/src/types/package.ts (1)

26-26: LGTM! Renaming aligns with API schema changes.

The rename from PackageDependency to PackageListingDependency correctly reflects that these dependencies are returned with package listings, improving clarity.

Also applies to: 37-45

apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)

1-1: LGTM! Import updated correctly.

The schema import and type reference are correctly updated to use packageListingDependencySchema.

Also applies to: 6-6

packages/thunderstore-api/src/schemas/objectSchemas.ts (1)

145-157: LGTM! Schema rename improves clarity.

The rename from packageDependencySchema to packageListingDependencySchema accurately reflects that this schema represents dependencies returned with package listings.

Also applies to: 163-163

Comment on lines +143 to +152
export const packageVersionDependenciesResponseDataSchema = z.object({
count: z.number(),
next: z.string().url().nullable(),
previous: z.string().url().nullable(),
results: z.array(packageVersionDependencySchema),
});

export type PackageVersionDependenciesResponseData = z.infer<
typeof packageVersionDependenciesResponseDataSchema
>;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Use paginatedResults helper for consistency.

This schema manually defines the pagination structure, but other paginated responses in this file use the paginatedResults helper (e.g., line 50-51). Using the helper maintains consistency and reduces duplication.

Apply this diff:

-export const packageVersionDependenciesResponseDataSchema = z.object({
-  count: z.number(),
-  next: z.string().url().nullable(),
-  previous: z.string().url().nullable(),
-  results: z.array(packageVersionDependencySchema),
-});
+export const packageVersionDependenciesResponseDataSchema = paginatedResults(
+  packageVersionDependencySchema
+);

Note: The helper uses z.string().nullable() without .url() validation. If URL validation is required, consider updating the helper itself to benefit all paginated schemas.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const packageVersionDependenciesResponseDataSchema = z.object({
count: z.number(),
next: z.string().url().nullable(),
previous: z.string().url().nullable(),
results: z.array(packageVersionDependencySchema),
});
export type PackageVersionDependenciesResponseData = z.infer<
typeof packageVersionDependenciesResponseDataSchema
>;
export const packageVersionDependenciesResponseDataSchema = paginatedResults(
packageVersionDependencySchema
);
export type PackageVersionDependenciesResponseData = z.infer<
typeof packageVersionDependenciesResponseDataSchema
>;
🤖 Prompt for AI Agents
In packages/thunderstore-api/src/schemas/responseSchemas.ts around lines 143 to
152, replace the manually defined packageVersionDependenciesResponseDataSchema
with the existing paginatedResults helper so the schema becomes
paginatedResults(packageVersionDependencySchema) and update the exported type to
infer from that helper; ensure paginatedResults is imported from its module at
the top of the file (or add the import) and, if URL validation is required for
next/previous, update the paginatedResults helper itself to use
z.string().url().nullable().

…siondependencies_to_dapper_and_dapperfake

Add getPackageVersionDependencies to Dapper and DapperFake
@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 31.40496% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.64%. Comparing base (5c6383b) to head (4cc2b3d).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
packages/dapper-fake/src/fakers/package.ts 0.00% 37 Missing ⚠️
packages/dapper-ts/src/methods/package.ts 3.84% 25 Missing ⚠️
...derstore-api/src/get/packageVersionDependencies.ts 20.00% 20 Missing ⚠️
packages/dapper-fake/src/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1566      +/-   ##
==========================================
+ Coverage   10.53%   10.64%   +0.10%     
==========================================
  Files         287      288       +1     
  Lines       20469    20587     +118     
  Branches      386      386              
==========================================
+ Hits         2156     2191      +35     
- Misses      18313    18396      +83     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/dapper/src/types/methods.ts (1)

76-81: Swap GetPackagePermissions to (communityId, namespaceId, packageName)

  • In packages/dapper/src/types/methods.ts, change:
-export type GetPackagePermissions = (
-  namespaceId: string,
-  communityId: string,
-  packageName: string
-) => Promise<PackagePermissions | undefined>;
+export type GetPackagePermissions = (
+  communityId: string,
+  namespaceId: string,
+  packageName: string
+) => Promise<PackagePermissions | undefined>;
  • In DapperFake (e.g. packages/dapper/src/fakes), replace:
-public getPackagePermissions = getFakePackagePermissions;
+public getPackagePermissions = (
+  communityId: string,
+  namespaceId: string,
+  packageName: string
+) => getFakePackagePermissions(communityId, namespaceId, packageName);
🧹 Nitpick comments (4)
packages/dapper-ts/src/__tests__/index.test.ts (1)

41-50: Skip ok for now — track enabling test

Good to add coverage placeholder. Please create a follow-up to unskip once the e2e/mocking strategy is in place.

Consider adding a unit-level mock test for dapper-ts method shape to avoid depending on e2e.

packages/dapper-fake/src/fakers/package.ts (1)

193-234: Make fake data deterministic per (namespace, name, version) and avoid module-scoped randomness

Current approach builds a static dataset at import time, so results are identical for all inputs and vary across runs. Seed inside the function and generate items there.

Apply this refactor:

-const fakePackageVersionDependencies = range(25).map(() => ({
-  description: faker.company.buzzPhrase(),
-  icon_url: getFakeImg(256, 256),
-  is_active: faker.datatype.boolean(0.5),
-  name: faker.word.words(3).split(" ").join("_"),
-  namespace: faker.word.sample(),
-  version_number: getVersionNumber(),
-  is_removed: faker.datatype.boolean(0.5),
-}));
-
-export const getFakePackageVersionDependencies = async (
+export const getFakePackageVersionDependencies = async (
   namespace: string,
   name: string,
   version: string,
   page?: number
 ) => {
-  setSeed(`${namespace}-${name}-${version}`);
-  page = page ?? 1;
-
-  // Split the fake data into pages of 10 items each.
-
-  const start = (page - 1) * 10;
-  const end = start + 10;
-  const items = fakePackageVersionDependencies.slice(start, end);
-
-  return {
-    count: fakePackageVersionDependencies.length,
+  setSeed(`${namespace}-${name}-${version}`);
+  const PAGE_SIZE = 10;
+  const total = 25; // keep overall count stable
+  const currentPage = Math.max(1, page ?? 1);
+
+  // Build deterministic page data for this (ns, name, version)
+  const all = range(total).map(() => ({
+    description: faker.company.buzzPhrase(),
+    icon_url: getFakeImg(256, 256),
+    is_active: faker.datatype.boolean(0.5),
+    name: faker.word.words(3).split(" ").join("_"),
+    namespace: faker.word.sample(),
+    version_number: getVersionNumber(),
+    is_removed: faker.datatype.boolean(0.5),
+  }));
+
+  const start = (currentPage - 1) * PAGE_SIZE;
+  const end = start + PAGE_SIZE;
+  const items = all.slice(start, end);
+
+  return {
+    count: total,
     next:
-      end < fakePackageVersionDependencies.length
+      end < total
         ? `https://thunderstore.io/api/cyberstorm/package/${namespace}/${name}/v/${version}/dependencies/?page=${
-            page + 1
+            currentPage + 1
           }`
         : null,
     previous:
-      page > 1
+      currentPage > 1
         ? `https://thunderstore.io/api/cyberstorm/package/${namespace}/${name}/v/${version}/dependencies/?page=${
-            page - 1
+            currentPage - 1
           }`
         : null,
     results: items,
   };
 };
packages/dapper-ts/src/index.ts (1)

19-20: Wire-up looks good; minor binding style nit

Bindings and exposure of getPackageVersionDependencies look correct. For consistency with neighboring bindings, keep it on one line.

-    this.getPackageVersionDependencies =
-      this.getPackageVersionDependencies.bind(this);
+    this.getPackageVersionDependencies = this.getPackageVersionDependencies.bind(this);

Also applies to: 55-56, 82-82

packages/dapper-ts/src/methods/package.ts (1)

106-133: Avoid sending page=undefined; defer to API default when not provided

If page isn’t passed, this builds a queryParams array with value: undefined. Depending on the query builder, this might serialize to page=undefined. Prefer omitting queryParams entirely to use the endpoint’s default (page=1).

 export async function getPackageVersionDependencies(
   this: DapperTsInterface,
   namespaceId: string,
   packageName: string,
   versionNumber: string,
   page?: number
 ) {
-  const options: PackageVersionDependenciesRequestQueryParams = [
-    {
-      key: "page",
-      value: page,
-      impotent: 1,
-    },
-  ];
+  const queryParams: PackageVersionDependenciesRequestQueryParams | undefined =
+    page == null
+      ? undefined
+      : [
+          {
+            key: "page",
+            value: page,
+            impotent: 1,
+          },
+        ];
 
   const data = await fetchPackageVersionDependencies({
     config: this.config,
     params: {
       namespace_id: namespaceId,
       package_name: packageName,
       version_number: versionNumber,
     },
     data: {},
-    queryParams: options,
+    queryParams,
   });
 
   return data;
 }

Please confirm your query builder drops params with undefined when impotent is set. If not, the above change is necessary to prevent page=undefined.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b133488 and 4cc2b3d.

📒 Files selected for processing (8)
  • packages/dapper-fake/src/fakers/package.ts (1 hunks)
  • packages/dapper-fake/src/index.ts (2 hunks)
  • packages/dapper-ts/src/__tests__/index.test.ts (2 hunks)
  • packages/dapper-ts/src/index.ts (3 hunks)
  • packages/dapper-ts/src/methods/package.ts (2 hunks)
  • packages/dapper/src/dapper.ts (1 hunks)
  • packages/dapper/src/types/methods.ts (2 hunks)
  • packages/dapper/src/types/package.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
packages/dapper/src/dapper.ts (1)
packages/dapper/src/types/methods.ts (1)
  • GetPackageVersionDependencies (69-74)
packages/dapper-fake/src/index.ts (1)
packages/dapper-fake/src/fakers/package.ts (1)
  • getFakePackageVersionDependencies (203-234)
packages/dapper-ts/src/methods/package.ts (3)
packages/dapper-ts/src/index.ts (1)
  • DapperTsInterface (32-35)
packages/thunderstore-api/src/schemas/requestSchemas.ts (1)
  • PackageVersionDependenciesRequestQueryParams (205-207)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (1)
  • fetchPackageVersionDependencies (11-35)
packages/dapper-ts/src/index.ts (1)
packages/dapper-ts/src/methods/package.ts (1)
  • getPackageVersionDependencies (106-133)
packages/dapper-fake/src/fakers/package.ts (1)
packages/dapper-fake/src/fakers/utils.ts (3)
  • range (69-69)
  • getFakeImg (3-4)
  • setSeed (74-77)
packages/dapper/src/types/methods.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageVersionDependencies (70-75)
packages/dapper/src/types/package.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (2)
  • PackageListingDependency (155-157)
  • PackageVersionDependency (259-261)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (6)
packages/dapper/src/types/methods.ts (2)

13-14: LGTM: type import

Importing PackageVersionDependencies aligns with the new API surface.


69-75: LGTM: new method type

Signature matches the rest of the API (namespace, name, version, page?).

packages/dapper/src/dapper.ts (1)

13-13: All DapperInterface implementers provide getPackageVersionDependencies

DapperFake in packages/dapper-fake/src/index.ts correctly defines getPackageVersionDependencies; no further changes required.

packages/dapper-fake/src/index.ts (1)

39-40: LGTM: dapper-ts now exposes getPackageVersionDependencies
DapperTs class binds and re-exports getPackageVersionDependencies in its public API.

packages/dapper-ts/src/methods/package.ts (1)

12-14: Imports LGTM

Correct imports for the new endpoint and query param type.

packages/dapper/src/types/package.ts (1)

26-45: Retain explicit pagination fields; icon_url nullability is correct

  • Local PaginatedList uses hasMore instead of previous/next, so swapping PackageVersionDependencies would change its shape.
  • The API schema defines icon_url as non-nullable, so string is correct for PackageVersionDependency.

Likely an incorrect or invalid review comment.

@Oksamies Oksamies merged commit 6b385b2 into master Oct 13, 2025
29 of 31 checks passed
@Oksamies Oksamies deleted the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch October 13, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants